import { createRouter, createWebHashHistory } from 'vue-router'
const router = createRouter({
  mode: 'hash',
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      redirect: '/main'
    },
    {
      path: '/login',
      name: '登录',
      component: () => import('@/views/login/index.vue')
    },
    {
      path: '/face',
      name: '人脸登录',
      component: () => import('@/views/face/index.vue')
    },
    {
      path: '/main',
      redirect: '/desktop',
      name: '主容器',
      component: () => import('@/views/main/index.vue'),
      children: [
        {
          path: '/desktop',
          name: '主页',
          component: () => import('@/views/children/desktop/index.vue')
        },
        {
          path: '/setting',
          name: '设置',
          component: () => import('@/views/children/setting/index.vue')
        },
        {
          path: '/appStore',
          name: '应用商店',
          component: () => import('@/views/children/appStore/index.vue')
        },
        {
          path: '/dynamicApp',
          name: '动态应用',
          component: () => import('@/views/children/dynamicApp/index.vue')
        }
      ]
    }
  ]
})
export default router
